feat: introduce -error versions of configs that have all rules configured to error#2796
feat: introduce -error versions of configs that have all rules configured to error#2796waynzh merged 23 commits intovuejs:masterfrom
-error versions of configs that have all rules configured to error#2796Conversation
🦋 Changeset detectedLatest commit: 215633d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1d9181a to
c26aeb9
Compare
|
@waynzh would it be possible to get a review or even just a yay/nay on if you're open to this? |
|
I'm unsure whether an environment variable is the correct approach to this. Maybe it would be better to duplicate the configs with an |
|
I'm personally not fussed so if you're happy having double the amount of configs I'm fine to do it that way too - I just figured the env variable was a nice way of leveraging the fact that going forward you have to use a JS file for the ESLint config (meaning its always possible to ensure that the property on |
|
@ota-meshi @waynzh What do you think? |
|
I've been thinking about this for a few days, and my personal opinion is that I'm against adding new shareable configs or making major changes to them.
I'm not a fan of using environment variables. |
|
For the IDE DX issue, you can address it by configuring the IDE-ESLint integration like this: "eslint.rules.customizations": [
{ "rule": "*", "severity": "error" }
// { "rule": "vue/*", "severity": "error" }
]I'm not a big fan of controlling this via environment variables either. |
That only works for VSCode
Sounds like folks are against that, so I'll switch to generating new configs |
a2795d8 to
3825a40
Compare
|
@FloEdelmann @waynzh @ota-meshi I've updated the implementation to generate dedicated configs instead of using an env variable |
error instead of warn using env variable-error versions of configs that have all rules configured to error
Revert "feat: support using `error` instead of `warn` for rules in config" This reverts commit efb2832. Revert "feat: regenerate configs" This reverts commit a379d77. Revert "feat: only define variable if it is needed" This reverts commit be3db8d. Revert "feat: regenerate rules" This reverts commit 98888a6. Revert "docs: add note to user guide" This reverts commit 3dd94e3. Revert "fix: avoid unneeded blank line" This reverts commit d7990e9.
168cf66 to
e77678a
Compare
FloEdelmann
left a comment
There was a problem hiding this comment.
Sorry for the late review. I still like the idea of more strict configs, so this mostly looks good to me 🙂
I have a few code and docs remarks though.
FloEdelmann
left a comment
There was a problem hiding this comment.
Thanks, looks good to me now 🙂
There was a problem hiding this comment.
Pull request overview
This PR introduces -error variants of existing ESLint config presets to provide users with stricter configurations where all rules report as errors instead of warnings. This resolves issue #2774 by giving users an alternative to manually overriding warning severities.
Key Changes:
- Modified config generator scripts to automatically create
-errorversions of warn-based configs - Generated 8 new config files (4 legacy + 4 flat) for
strongly-recommended-errorandrecommended-errorvariants (Vue 2 & 3) - Updated documentation to describe the new config options
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/update-lib-flat-configs.js | Modified generator to create -error flat config variants with alwaysError parameter |
| tools/update-lib-configs.js | Modified generator to create -error legacy config variants with alwaysError parameter |
| lib/configs/vue3-strongly-recommended-error.js | Generated legacy config extending vue3-essential with strongly-recommended rules as errors |
| lib/configs/vue3-recommended-error.js | Generated legacy config extending vue3-strongly-recommended-error with recommended rules as errors |
| lib/configs/vue2-strongly-recommended-error.js | Generated legacy config extending vue2-essential with strongly-recommended rules as errors |
| lib/configs/vue2-recommended-error.js | Generated legacy config extending vue2-strongly-recommended-error with recommended rules as errors |
| lib/configs/flat/vue3-strongly-recommended-error.js | Generated flat config extending vue3-essential with strongly-recommended rules as errors |
| lib/configs/flat/vue3-recommended-error.js | Generated flat config extending vue3-strongly-recommended-error with recommended rules as errors |
| lib/configs/flat/vue2-strongly-recommended-error.js | Generated flat config extending vue2-essential with strongly-recommended rules as errors |
| lib/configs/flat/vue2-recommended-error.js | Generated flat config extending vue2-strongly-recommended-error with recommended rules as errors |
| docs/user-guide/index.md | Added documentation entries for all new -error config variants with usage descriptions |
| .changeset/brown-eels-care.md | Added changeset describing the new feature as a minor version bump |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@G-Rath can you please have a look at Copilot's suggestions? Some of them seem to make sense. Feel free to just comment on and resolve the invalid ones. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@FloEdelmann should be all good to go now |
I'm happy to take alternative names for the environment and local config variables
Resolves #2774